<?php

/**
 * Category Model - Database functions related to category table
 * 
 * @project : Loobica
 * @author  : Dino
 * @date    : 03 Mar 2014
 * 
 */
class Category_model extends CI_Model {

  function __construct() {
    parent::__construct();
  }

  /**
   * Get Categories
   * 
   * @return type
   */
  function get_categories() {
    return $this->db->select('*')
                    ->get('category')
                    ->result_array();
  }

  /**
   * Get Category
   * 
   * @param type $category_id
   * @return type
   */
  function get_category($category_id = 0) {
    return $this->db->select('*')
                    ->where('category_id', (int) $category_id)
                    ->get('category')
                    ->row_array();
  }

}

?>